package demo1;

import java.util.Arrays;

class Student {
    public String name;
    public int age;

    public Student() {}

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Test{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}

public class Test {

    public static void main(String[] args) {
        Student student1 = new Student("张三", 19);
        Student student2 = new Student("李四", 9);
        Student student3 = new Student("王五", 25);

        Student[] students = new Student[3];
        students[0] = new Student("张三", 19);
        students[1] = new Student("李四", 9);
        students[2] = new Student("王五", 25);

        System.out.println("排序前"+Arrays.toString(students));

    }
}
